import 'package:flutter_deer/generated/json/base/json_field.dart';
import 'package:flutter_deer/generated/json/res_discount_count_entity.g.dart';
import 'dart:convert';
export 'package:flutter_deer/generated/json/res_discount_count_entity.g.dart';

@JsonSerializable()
class ResDiscountCountEntity {
	String? availableCount = '';
	int? couponOverlayLimit = 0;
	String? discountMaxAmount = '';
	int? storeGoodsCouponConfig = 0;//"商品优惠券配置(1 与能源优惠券叠加; 2 与能源优惠券互斥)"
	String? unavailableCount = '';

	ResDiscountCountEntity();

	factory ResDiscountCountEntity.fromJson(Map<String, dynamic> json) => $ResDiscountCountEntityFromJson(json);

	Map<String, dynamic> toJson() => $ResDiscountCountEntityToJson(this);

	String getAvailableCountStr() {
		 if (availableCount == '10') {
			 return '10+';
		} else {
			 return availableCount ?? '';
		}
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}